<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title> 关注自动回复</title>
    <link rel="stylesheet" href="${base}/res/manage/css/common.css">
    <link rel="stylesheet" href="${base}/res/manage/css/ec.css">
    <link rel="stylesheet" href="${base}/res/manage/css/list.css">
    <script type="text/javascript" src="${base}/res/plugin/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${base}/res/plugin/validator/jquery.validate.min.js"></script>
    <script type="text/javascript" src="${base}/res/admin/js/common.js"></script>
    <script type="text/javascript" src="${base}/res/admin/js/list.js"></script>
    <script type="text/javascript" src="${base}/res/admin/js/scrollView.js"></script>
    <script type="text/javascript" src="${base}/res/admin/js/initWidth.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
        [@flash_message /]

            //为删除按钮添加删除事件
            $("a[class='delete']").click(function () {
                var idName = $(this).attr("idName");
                var idVal = $(this).attr("idVal");
                if (idVal == null || idVal == "") {
                    alert("必需参数错误!");
                    return;
                }
                if (idName == null || idName == "") {
                    idName = "com.project.common.web.utils.id";
                }
                if (confirm("确定要删除此信息吗?")) {
                    location.href = "deleteSubscribe.jhtml?" + idName + "=" + idVal;
                }
            });
            $(".disabled,.launch").on("click", function () {
                var text = "";
                if ($(this).hasClass("launch")) {
                    text = "是否启用?";
                } else {
                    text = "是否禁用?";
                }
                if (confirm(text)) {
                    var id = $(this).attr("data-id");
                    var status = $(this).attr("data-isenabled")
                    location.href = "disabledSubscribe.jhtml?id=" + id+"&isEnabled="+status;
                }
            })
        });
    </script>
</head>
<body>
<div class="tab set">
    <h3>[#--<a href="javascript:;">首页</a>--]<a href="javascript:;">微信管理</a><a href="subscribeList.jhtml">> 关注自动回复管理</a></h3>
    <form id="listForm" action="subscribeList.jhtml" method="get">
        <div class="txte">
            <p class="txtl" ><a href="${base}/admin/wxReplay/addSubscribe.jhtml" class="ared "> + 添加关注回复</a></p>
        </div>
        <div class="tablist">
            <table cellpadding="0" cellspacing="0" class="scrollTable">
                <tr>
                    <th>关键字</th>
                    <th>消息类型</th>
                    <th>是否可用</th>
                    <th>创建时间</th>
                    <th class="icon">操作</th>
                </tr>
            [#list page.list as wxReplay]
                <tr>
                    <td class="center">
                        [#if wxReplay.keyword == "subscribe"]
                            关注
                        [/#if]
                        [#if wxReplay.keyword == "first_subscribe"]
                            首次关注
                        [/#if]
                    </td>
                    <td class="center">
                    ${stdCodeName("WX_REPLAY_MSG_TYPE",wxReplay.msgType)}
                    </td>
                    <td class="center">
                    ${stdCodeName("IS_ENABLED",wxReplay.isEnabled?string(1,0))}
                    </td>
                    <td class="center">
                        <span title="${wxReplay.createDate?string("yyyy-MM-dd")}">${wxReplay.createDate?string("yyyy-MM-dd")}</span>
                    </td>
                    <td class="icon">
                        <div>
                            <a class="[#if wxReplay.isEnabled]disabled[#else ]launch[/#if]" title="[#if wxReplay.isEnabled]禁用[#else ]启用[/#if]" data-id="${wxReplay.id}" data-isenabled="${wxReplay.isEnabled?string(1,0)}" ></a>
                            <a class="delete" title="删除" idName="id" idVal="${wxReplay.id}"
                               href="javascript:void(0)"></a>
                            <a class="edit" title="编辑" href="editSubscribe.jhtml?id=${wxReplay.id}"></a>
                        </div>
                    </td>
                </tr>
            [/#list]
            </table>
        [@pagination pageNumber = page.pageNumber totalPages = page.pages]
            [#include "/admin/include/pagination.ftl"]
        [/@pagination]
        </div>
    </form>
</div>
</body>
</html>